package com.ship.boats.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.boats.domain.SpBoatsAisMessage;
import com.ship.boats.domain.dto.CreateBoatsAisMessageRq;
import com.ship.boats.domain.vo.BoatsPerformanceAnalysisInfo;
import com.ship.common.datasource.annotation.Slave;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface SpBoatsAisMessageMapper extends BaseMapper<SpBoatsAisMessage> {
    @Slave
    void addBoatsAirMessage(CreateBoatsAisMessageRq boatsMessage);

    @Slave
    List<SpBoatsAisMessage> queryAISMessageByImo(@Param("imo") String imo,@Param("tableName") String tableName);

    @Slave
    List<BoatsPerformanceAnalysisInfo> queryBoatsPerformanceAnalysis(@Param("imo") String imo,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("tableName") String tableName);

    @Slave
//    @Update("CREATE TABLE #{tableName} AS TABLE boats_ais_message WITH NO DATA;")
    void createTable(@Param("tableName") String tableName);

    @Slave
    String queryTableName(@Param("tableName") String tableName);
}
